package com.example.demojdbc01.Mapper;

import com.example.demojdbc01.Entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface UserMapper {
    //查询所有
    public List<User> findAll();


    @Select("select * from demo01")
    public List<User> findAll1();
    //查询单条
    @Select("select * from demo01 where userid=#{userid}")
    public User findOne(String  userid);

    @Select("select * from demo01 where userid=#{userid}")
    public User findOne1(String  userid);

    @Delete("delete from demo01 where userid=#{userid}")
    public int delete(String userid);

    @Insert("insert into demo01 (userid,username,userpassword) values (#{userid},#{username},#{userpassword})")
    public int save(User user);
}
